package tests.第三方工具类测试使用.mapstruct.pojo;

public enum HeathEnum {
    Heath(1,"健康"),
    SICK(2,"生病"),
    DEAD(3,"死亡");

    private Integer code;
    private String name;

    HeathEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }


    public static HeathEnum parse(Integer code){
        for (HeathEnum value : HeathEnum.values()) {
            if(value.getCode().equals(code)) return value;
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
